<?php
class RunupdateAction extends Action {
	 /*
	 *@一键更新
	 */
	 public function update_real_pay(){
		import("Com.KitMoney");
		$kitmoney = new KitMoney();
		$order = M('order');
		$where = array();
		$where['platform'] = 'SMW01';
		$day = intval($_REQUEST['day']);
		$nowtime=date("Y-m-d H:i:s");
		if(!empty($day)){
			$oldtime=strtotime("$nowtime-".$day." day");
			$where['add_time'] = array('GT',$oldtime);
		}
		$res = $order->field('sn')->where($where)->select();
		foreach ($res as $key => $value) {
			$order=$kitmoney->order_statis($value['sn']);
		}
		if($order != false){
			echo '区域订单实际支付-更新成功'.$nowtime;
		}else{
			echo '区域订单实际支付-更新失败'.$nowtime;
		}
	}
}
?>